<template>
  <div>
    <el-card style="margin-top: 10px">
      <el-form :inline="true">
        <el-form-item label="用户姓名">
          <el-input v-model="beforeUserName" placeholder="姓名"></el-input>
        </el-form-item>
        <el-form-item label="店铺名称">
          <el-input v-model="storeName" placeholder="店铺"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="gettableData()">查询</el-button>
        </el-form-item>
      </el-form>
      <el-table :data="tableData" border style="width: 100%">
        <el-table-column prop="beforeUser.beforeUserName" label="用户姓名"></el-table-column>
        <el-table-column prop="storeName" label="店铺名称"></el-table-column>
        <el-table-column label="店铺头像">
          <template v-slot="scope">
            <el-image :src="scope.row.storeImg" style="width: 60px;height: 60px"></el-image>
          </template>
        </el-table-column>
        <el-table-column label="操作">
          <template v-slot="scope">
            <el-button type="primary" plain size="mini" @click="TowDianShen(scope.row.storeId)">审核通过</el-button>
            <el-button type="primary" size="mini" @click="TowDianShenNo(scope.row.storeId)">审核不通过</el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
  import Api from '@/api/audit/auditStore'
export default {
  data(){
    return{
      tableData:[],
      beforeUserName:'',
      storeName:'',
    }
  },
  created() {
    this.gettableData()
  },
  methods:{
    gettableData(){
      Api.gettableData(this.beforeUserName,this.storeName)
        .then(res=>{
          console.log(res)
          this.tableData = res.data.list
        })
    },
    TowDianShen(storeId){
      Api.TowDianShen(storeId)
        .then(res=>{
          this.gettableData();
          this.$notify.success({
            title: '审核通过',
          });
        })
    },
    TowDianShenNo(storeId){
      Api.TowDianShenNo(storeId)
        .then(res=>{
          this.gettableData();
          this.$notify.error({
            title: '审核未通过',
          });
        })
    }
  }
}
</script>

<style>

</style>
